var mysql = require('mysql')


const mysqlobj = mysql.createConnection({
  host:'localhost',
  user:'root',
  password:'root',
  database:'day10zuoye',
  port:3306
})

function mysqli(sql){
    return new Promise((resolve)=>{
        mysqlobj.query(sql,(err,result)=>{
            resolve({err,result})
        })
    })
}

module.exports = mysqli//暴露